package ltd.hxya.novel.admin.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import ltd.hxya.novel.admin.entity.Operation;
import ltd.hxya.novel.admin.entity.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import ltd.hxya.novel.admin.vo.UserVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 用户信息表 Mapper 接口
 * </p>
 *
 * @author hty
 * @since 2022-10-03
 */
@Mapper
public interface UserMapper extends BaseMapper<User> {

    List<String> getPermissionsByUserId(Integer userId);

    Page<UserVo> grantedUser(Page<UserVo> page,@Param("userVo") UserVo userVo);

    Page<UserVo> ungrantedUser(Page<UserVo> page,@Param("userVo") UserVo userVo);

    Page<Operation> getPagePermissionsByUserId(Page<Operation> page, Integer userId);
}
